package org.nstack.header.volume;

import org.nstack.header.message.APICreateMessage;
import org.nstack.header.message.APIParam;
import org.nstack.header.storage.snapshot.VolumeSnapshotConstant;
import org.springframework.http.HttpMethod;
import org.nstack.header.identity.Action;
import org.nstack.header.rest.RestRequest;


@Action(category = VolumeSnapshotConstant.ACTION_CATEGORY)
@RestRequest(
        path = "/volumes/{volumeUuid}/volume-snapshots",
        method = HttpMethod.POST,
        responseClass = APICreateVolumeSnapshotEvent.class,
        parameterName = "params"
)
public class APICreateVolumeSnapshotMsg extends APICreateMessage implements VolumeMessage {

    @APIParam(resourceType = VolumeVO.class, checkAccount = true, operationTarget = true)
    private String volumeUuid;

    @APIParam(maxLength = 255)
    private String name;

    @APIParam(required = false, maxLength = 2048)
    private String description;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getVolumeUuid() {
        return volumeUuid;
    }

    public void setVolumeUuid(String volumeUuid) {
        this.volumeUuid = volumeUuid;
    }
 
    public static APICreateVolumeSnapshotMsg __example__() {
        APICreateVolumeSnapshotMsg msg = new APICreateVolumeSnapshotMsg();
        msg.setName("snapshot-volume");
        msg.setDescription("a snapshot for volume");
        msg.setVolumeUuid(uuid());

        return msg;
    }

}
